package me.spring.cloud.components.starter.httplog.configuration;

import me.spring.cloud.common.components.log.aop.CommonLogAspect;
import me.spring.cloud.common.components.log.aop.LogHandler;
import me.spring.cloud.common.components.log.service.TraceLogService;
import me.spring.cloud.common.components.log.service.TraceLogServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author luffy
 */
@Configuration
@Import(CommonLogAspect.class)
public class AspectLogConfiguration {

    @Bean
    public TraceLogService traceLogService() {
        return new TraceLogServiceImpl();
    }

    @Bean
    public LogHandler logHandler() {
        return new LogHandler(traceLogService());
    }
}